/**************************************************************************
 * @doc CONFIGURATION
 * @module fielddef.h |  
 * Header file for configuration field data files
 *
 * Product     :   SoftPay 2000 (Global Payment Methodology).
 * <nl>Developer   :   
 * <nl>Notes       :
 *
 * @head3 CONFIGURATION |
 * @index CONFIGURATION | 
 * @end
 *
 * Copyright (c) 1996-2000 by VeriFone Inc. All rights reserved.
 * 
 * No part of this software may be used, stored, compiled, reproduced,
 * modified, transcribed, translated, transmitted, or transferred, in any form 
 * or by any means whether electronic, mechanical, magnetic, optical, 
 * or otherwise, without the express prior written permission of VeriFone, Inc.
 *
 * Revision History
 * ------------------------------------------------------------------------
 $log:  $
 * ------------------------------------------------------------------------
 ********************************************************************************/

#ifndef FIELDDEF_H
#define FIELDDEF_H

#define FLD_NULL  0x00        /* To signify "End of Table" */
#define FLD_CHAR  0x01        /* Stores single key press value */
#define FLD_SHORT 0x02        /* only INPUT_NUMS IO Type is appropriate */
#define FLD_INT   0x04        /* only INPUT_NUMS IO Type is appropriate */
#define FLD_LONG  0x08        /* only INPUT_NUMS IO Type is appropriate */
                                /* support for float is questionable */
#define FLD_DBL   0x0A        /* only INPUT_NUMS IO Type is appropriate */
#define FLD_BIT   0x0B        /* Bit fields(0 or 1) only INPUT_FLAG IO Type is appropriate */
#define FLD_STR   0x0C        /* NULL_CH terminated string */
#define FLD_BYTE  0x0D        /* only INPUT_NUMS IO Type is appropriate */
#define FLD_SHARR 0x0E        /* short array */

#define MSB_MASK  0x80          /* Mask all bits other than MSB (1000 0000). */

#define CONFIG_NM_SIZE      8   /* E.g., CDT99 */

#define INPUT_NUMS          0   /* Input numeric keys only. */
#define INPUT_ALNUMS        1   /* Input alphanumeric keys. */
#define INPUT_HIDE_NUMS     2   /* Input numeric keys with asterisk echo. */
#define INPUT_HIDE_ALNUMS   3   /* Input alnumeric keys with asterisk echo. */
#define INPUT_FLAG          4   /* Input 1 or 0 */

#define BIT_SIZE            1
#define CHAR_SIZE           1
#define BYTE_SIZE           1
#define INT_SIZE            2
#define LONG_SIZE           4
#define SHORT_SIZE          2

#define FIELD_NAME_SIZE     15

/*
 * Attributes of each of the fields in the data structures.
 * inFldType   = Type of the field to be extracted.
 * chFldLen    = Maximum length of the field.
 * These field attributes are required in order to know the type and
 * maximum length of the field to be extracted.
 */
#ifndef uchar
typedef uchar unsigned char
#endif

define FIELDDEF BIN
{
   (short,  inFieldName,                    "Name of field")
   (char,   ucFieldType,       	    		"Field Type")
   (char,	szFieldLabel[CONFIG_NM_SIZE],   "Field Label")
   (short ,  shFieldFuncID,        	    		"Validation Function Field ID")
   (short,  inFieldSize,                    "Field's size" )
   (bit,    fPad1,                          "Bit Padding")
   (bit,    fPad2,                          "Bit Padding")
   (bit,    fPad3,                          "Bit Padding")
   (bit,    fPad4,                          "Bit Padding")
   (bit,    fPad5,                          "Bit Padding")
   (bit,    fPad6,                          "Bit Padding")
   (bit,    fPad7,                          "Bit Padding")
   (bit,    fPad8,                          "Bit Padding")
   (bit,    fPad9,                          "Bit Padding")
   (bit,    fFieldEditOpenBatch,            "Edit field if batch is open")
   (bit,    fFieldShow,                     "Display field value")
   (bit,    fFieldEditable,                 "Allow changes")
   (bit,    fFieldTitle,                    "Main textual distinguisher")
   (bit,    fFieldZonTalks,                 "Can be changed via Zontalk")
   (bit,    fFieldPrint,                    "Print in configuration report")
   (bit,    fAltEntry,                		"Unused")
   (char,   chFieldIOFmt,                   "Format spec for I/O")
   (short,  inFieldFullSize,                "Size of the field's container" )
   (short,  inFieldPos,                     "Offset of field relative to record start")
   (short,  inFieldBitNum,                  "Offset of bit field relative to int start")
}

#endif
